package com.repouniversity.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.repouniversity.api.service.FileRequest;
import com.repouniversity.api.service.FileResponse;
import com.repouniversity.api.service.FileService;

@Controller
public class TestController {
	
	@Autowired
	FileService fileService;

	@RequestMapping(value="/test", produces=MediaType.APPLICATION_JSON_VALUE)
	public @ResponseBody String test() {
		return "hola";
	}
	@RequestMapping (value="/test2", method=RequestMethod.GET)
	public ModelAndView test2(){
		
		FileResponse response = fileService.find(new FileRequest());
		return new ModelAndView("primerpantalla");
	}

}
